<?php

include '../include/init.php';

$filename=$_POST['picname'];
if(!is_dir(ROOT.'upload'))
{
	mkdir(ROOT.'upload');
}
if(!file_exists(ROOT.'upload/'.$filename))
{
	move_uploaded_file($_FILES['partpic']['tmp_name'],ROOT.'upload/'.$filename);
}
else {
	file_put_contents(ROOT.'upload/'.$filename,file_get_contents($_FILES['partpic']['tmp_name']),FILE_APPEND);
}